//
//  shareViewController.m
//  giuseppe
//
//  Created by Apple on 15/8/13.
//  Copyright (c) 2015年 GiantUmbrella. All rights reserved.
//

#import "shareViewController.h"
#import "define.h"

@interface shareViewController (){
    
    NSArray *imageNameArray;
    
}

@end

@implementation shareViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    
    
    
    //自定义的导航栏
    UIView *navView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, 64)];
//    navView.backgroundColor = [UIColor whiteColor];
    navView.backgroundColor = baseColor;
    navView.alpha = 0.90;
    
    UIButton *backButton = [UIButton buttonWithType:UIButtonTypeCustom];
    backButton.frame = CGRectMake(10, 33, 27, 16);
    [backButton setBackgroundImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    
    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(kScreenWidth/2-50, 20, 100, 40)];
    titleLabel.text = @"邀请好友";
    titleLabel.textAlignment = NSTextAlignmentCenter;
    
    
    [self _initView];
    
    
    [navView addSubview:backButton];
    [navView addSubview:titleLabel];
    
    
    [self.view addSubview:navView];
    
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
}



- (void)_initView{
    
    
    imageNameArray = [[NSArray alloc]init];
    
    imageNameArray = @[@"skyblue_logo_wechat_checked",@"skyblue_logo_wechatmoments_checked",@"skyblue_logo_sinaweibo_checked",@"skyblue_logo_qq_checked",@"skyblue_logo_qzone_checked"];
    
    for (int i = 0; i < 5; i ++) {
        
        UIButton *shareButton = [UIButton buttonWithType:UIButtonTypeCustom];
        shareButton.layer.masksToBounds = YES;
        shareButton.layer.cornerRadius = (kScreenWidth-120)/5/2;
        
        shareButton.frame = CGRectMake(20+((kScreenWidth-120)/5+20)*i, 80, (kScreenWidth-120)/5, (kScreenWidth-120)/5);
        
        shareButton.tag = 100+i;
        [shareButton setImage:[UIImage imageNamed:imageNameArray[i]] forState:UIControlStateNormal];
        
        [self.view addSubview:shareButton];
        
    }
    
    
}

#pragma mark - UITableView Delegate && DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    
    return 10;
    
    
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *ID = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    if (cell==nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
    }
    
    return cell;
    
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
    return 50;
}


- (void)back{
    
    [self.navigationController popViewControllerAnimated:YES];
    
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
